function GAD_Etom_Place_vs_NonPlace_meanER(Mobility_and_ER_Data_Summary)
%% get mean ER for place cells and non-place cells in both genotypes
for n = 1:size(Mobility_and_ER_Data_Summary,2)
    if strcmp(Mobility_and_ER_Data_Summary(n).genotype, 'a5-i-WT')
        WT_PlaceCell_meanER(n,1) = Mobility_and_ER_Data_Summary(n).Mean_PlaceCellER;
    end
end
WT_PlaceCell_meanER(WT_PlaceCell_meanER==0) = nan;
WT_PlaceCell_meanER(isnan(WT_PlaceCell_meanER)) = [];

for n = 1:size(Mobility_and_ER_Data_Summary,2)
    if strcmp(Mobility_and_ER_Data_Summary(n).genotype, 'a5-i-WT')
        WT_NonPlaceCell_meanER(n,1) = Mobility_and_ER_Data_Summary(n).Mean_NonPlaceCellER;
    end
end
WT_NonPlaceCell_meanER(WT_NonPlaceCell_meanER==0) = nan;
WT_NonPlaceCell_meanER(isnan(WT_NonPlaceCell_meanER)) = [];




for n = 1:size(Mobility_and_ER_Data_Summary,2)
    if strcmp(Mobility_and_ER_Data_Summary(n).genotype, 'a5-i-KO')
        KO_PlaceCell_meanER(n,1) = Mobility_and_ER_Data_Summary(n).Mean_PlaceCellER;
    end
end
KO_PlaceCell_meanER(KO_PlaceCell_meanER==0) = nan;
KO_PlaceCell_meanER(isnan(KO_PlaceCell_meanER)) = [];

for n = 1:size(Mobility_and_ER_Data_Summary,2)
    if strcmp(Mobility_and_ER_Data_Summary(n).genotype, 'a5-i-KO')
        KO_NonPlaceCell_meanER(n,1) = Mobility_and_ER_Data_Summary(n).Mean_NonPlaceCellER;
    end
end
KO_NonPlaceCell_meanER(KO_NonPlaceCell_meanER==0) = nan;
KO_NonPlaceCell_meanER(isnan(KO_NonPlaceCell_meanER)) = [];


%% Plot histogram

figure
subplot(1,2,1)
histogram(WT_PlaceCell_meanER, 40, 'BinLimits', [0, 0.3], 'FaceColor', 'r', 'FaceAlpha', 0.5)
hold on
histogram(WT_NonPlaceCell_meanER, 40, 'BinLimits', [0, 0.3], 'FaceColor', 'b', 'FaceAlpha', 0.5)
ylim([0,15])
legend('Place Cell', 'Non-Place Cell')
xlabel('mean(Event Rate) (Hz)')
ylabel('Number of Sessions')
set(gca, 'FontSize', 20)
title('p-WT', 'FontSize', 25)
hold off

subplot(1,2,2)
histogram(KO_PlaceCell_meanER, 40, 'BinLimits', [0, 0.3], 'FaceColor', 'r', 'FaceAlpha', 0.5)
hold on
histogram(KO_NonPlaceCell_meanER, 40, 'BinLimits', [0, 0.3], 'FaceColor', 'b', 'FaceAlpha', 0.5)
ylim([0,15])
legend('Place Cell', 'Non-Place Cell')
xlabel('mean(Event Rate) (Hz)')
ylabel('Number of Sessions')
set(gca, 'FontSize', 20)
title('\alpha5-i-KO', 'FontSize', 25)
hold off


end